Feat/stateles arch#1
Conversation
- Remove misleading transport auto-detection claims - Update to accurately describe Streamable HTTP transport - Remove unused benchmark files - Add transport design documentation - Update badges to reflect current capabilities
- Add lib.rs with public API and re-exports - Add error.rs with comprehensive error handling using thiserror - Add config.rs with strongly-typed configuration system - Implement builder patterns and validation - Add must_use attributes for better API design - Support for serializable configuration BREAKING CHANGE: Restructured from monolithic to modular architecture
- Add transport/mod.rs with HTTP client factory and connection management - Add proxy/mod.rs with core MCP message bridging logic - Implement stateless design with per-request connections - Add comprehensive error handling and recovery - Support for builder patterns and factory methods - Add must_use attributes and proper documentation
- Reduce main.rs from 353 to 61 lines (83% reduction) - Use new modular components (config, proxy, error handling) - Improve CLI argument parsing and error handling - Add comprehensive usage information and help text - Maintain backward compatibility with existing usage
- Add integration_tests.rs with 20 integration tests - Include unit tests in each module (26 total unit tests) - Add mock MCP server for integration testing - Test configuration validation, error handling, and proxy functionality - Include performance and memory usage tests - Achieve 90%+ test coverage for core functionality
- Add development dependencies for testing (futures, tokio test features) - Add serde and thiserror for new modular architecture - Update exclusions for cleaner packaging - Configure linting with clippy pedantic mode - Add proper MSRV specification (1.70+)
- Move test_stateless.sh and verify_stateless.sh to scripts/ directory - Improve project organization and maintainability - Keep development utilities in dedicated scripts folder
- Document the complete project restructuring process - Detail architectural improvements and quality metrics - Include before/after comparisons and benefits realized - Provide technical implementation highlights - Document lessons learned and future enhancements
- Remove outdated migration analysis and publishing docs - Remove unnecessary monitoring and build scripts - Remove duplicated test scripts (moved to scripts/ directory) - Clean up repository for better maintainability - Keep only essential development utilities
- Add 20+ modern badges following 2024-2025 GitHub best practices - Include MCP-specific badges from official badge service - Add comprehensive project stats and quality metrics - Update architecture documentation with new modular structure - Add performance metrics and technical specifications - Include proper acknowledgments and community information - Follow current visual design trends for open-source projects
- Add core CI workflow with testing, clippy, formatting - Add quality assurance workflow with security audits - Add test coverage workflow with cargo-llvm-cov - Add automated badge generation and maintenance - Add release preparation workflow with release-plz - Add local testing scripts and configuration - Clean up excessive documentation files
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a comprehensive stateless architecture rewrite of the zed-mcp-proxy project, transforming it from a traditional connection-managed proxy to a high-performance, on-demand proxy system. The changes implement strict stateless operation, modular code organization, comprehensive configuration management, and extensive testing infrastructure.
Key Changes:
- Complete restructuring into modular library architecture with stateless operation
- New configuration system with validation and builder patterns
- Comprehensive error handling with categorized error types
- Transport abstraction layer for HTTP connections
- Extensive integration and verification testing
- CI/CD workflow enhancements with automated testing and coverage
Reviewed Changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib.rs |
New library root with module exports and utility functions |
src/main.rs |
Streamlined CLI interface using modular library components |
src/config.rs |
Configuration management with validation and builder patterns |
src/error.rs |
Comprehensive error handling with categorized error types |
src/proxy/mod.rs |
Core stateless proxy implementation with MCP ServerHandler |
src/transport/mod.rs |
HTTP transport factory and connection management |
tests/integration_tests.rs |
Comprehensive integration test suite |
scripts/verify_stateless.sh |
Stateless operation verification script |
scripts/test_stateless.sh |
Concurrent load testing for stateless behavior |
scripts/coverage.sh |
Coverage generation and reporting script |
Comments suppressed due to low confidence (1)
tests/integration_tests.rs:20
- Integration tests are making real HTTP requests to external services (httpbin.org) which can cause flaky tests due to network dependencies. Consider using mock servers or local test doubles for more reliable testing.
.remote_url("https://httpbin.org/post".to_string()) // Use httpbin for real HTTP testing
| Duration::from_secs(self.timeouts.request_timeout_secs) | ||
| } | ||
|
|
||
| /// Get connect can timeout as Duration |
There was a problem hiding this comment.
Documentation comment contains a typo: 'connect can timeout' should be 'connect timeout'.
| /// Get connect can timeout as Duration | |
| /// Get connect timeout as Duration |
| // Create HTTP client | ||
| let http_client = self.create_http_client()?; | ||
|
|
||
| // Create HTTP transport configuration |
There was a problem hiding this comment.
Missing documentation for the 'allow_stateless' configuration field and its impact on transport behavior. This is a key architectural decision that should be documented.
| // Create HTTP transport configuration | |
| // Create HTTP transport configuration | |
| // Configure the transport with the remote URL and other settings. | |
| // The `allow_stateless` field determines whether the transport can operate | |
| // in a stateless mode. When set to `true`, the transport does not maintain | |
| // persistent state between requests, which can improve scalability but may | |
| // limit certain features that require stateful communication. |
| if [ -f "$(which $PROXY_NAME)" ]; then | ||
| BINARY_SIZE=$(ls -lh "$(which $PROXY_NAME)" | awk '{print $5}') | ||
| echo "• Binary size: $BINARY_SIZE (compact for stateless operation)" | ||
| fi | ||
|
|
||
| # Verify stateless indicators in verbose output | ||
| echo "" | ||
| echo "Checking for stateless indicators in proxy output..." | ||
| VERBOSE_OUTPUT=$(echo "$TEST_REQUEST" | ZED_MCP_PROXY_VERBOSE=1 $PROXY_NAME "$TEST_URL" 2>&1) |
There was a problem hiding this comment.
Shell script uses non-quoted variable expansions which could lead to word splitting issues. Consider using quoted variables: "$TEST_REQUEST", "$PROXY_NAME", "$TEST_URL".
| if [ -f "$(which $PROXY_NAME)" ]; then | |
| BINARY_SIZE=$(ls -lh "$(which $PROXY_NAME)" | awk '{print $5}') | |
| echo "• Binary size: $BINARY_SIZE (compact for stateless operation)" | |
| fi | |
| # Verify stateless indicators in verbose output | |
| echo "" | |
| echo "Checking for stateless indicators in proxy output..." | |
| VERBOSE_OUTPUT=$(echo "$TEST_REQUEST" | ZED_MCP_PROXY_VERBOSE=1 $PROXY_NAME "$TEST_URL" 2>&1) | |
| if [ -f "$(which "$PROXY_NAME")" ]; then | |
| BINARY_SIZE=$(ls -lh "$(which "$PROXY_NAME")" | awk '{print $5}') | |
| echo "• Binary size: $BINARY_SIZE (compact for stateless operation)" | |
| fi | |
| # Verify stateless indicators in verbose output | |
| echo "" | |
| echo "Checking for stateless indicators in proxy output..." | |
| VERBOSE_OUTPUT=$(echo "$TEST_REQUEST" | ZED_MCP_PROXY_VERBOSE=1 "$PROXY_NAME" "$TEST_URL" 2>&1) |
| } | ||
|
|
||
| /// Create a new HTTP client connection for a request (stateless operation) | ||
| async fn create_client_connection( |
There was a problem hiding this comment.
[nitpick] Creating a new HTTP client connection for every request could be inefficient. While this supports stateless operation, consider connection pooling or reuse strategies to improve performance while maintaining stateless benefits.
This pull request introduces significant updates to enhance CI/CD workflows, improve local testing configurations, and update project badges. Key changes include the addition of new CI jobs for code quality and security checks, updates to badge configurations, and automation for maintaining coverage badges.
CI/CD Workflow Enhancements:
.github/workflows/ci.yml: Introduced new CI jobs for formatting, Clippy lints, MSRV compatibility, security audits, dependency checks, cross-compilation, and performance tests. Added a daily CI schedule and optimized build performance with environment variables..github/workflows/coverage-badge.yml: Added a new workflow to automatically update coverage badges based on test results or manual overrides, including badge generation, README updates, and artifact uploads.Local Testing Improvements:
.actrc: Added a configuration file for local testing withact, specifying environment variables, platform details, and optimizations for faster runs.Badge Updates:
.github/badges/shields.yml: Updated the "Transport" badge to reflect universal transport compatibility and fixed formatting for thewith_alttemplate. [1] [2]